﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Server
{
   
    public class Rootobject
    {
        public string code { get; set; }
        public string updateTime { get; set; }
        public string fxLink { get; set; }
        public Now now { get; set; }
        public Refer refer { get; set; }
    }

    public class Now
    {
        public string obsTime { get; set; }
        public string temp { get; set; }
        public string feelsLike { get; set; }
        public string icon { get; set; }
        public string text { get; set; }
        public string wind360 { get; set; }
        public string windDir { get; set; }
        public string windScale { get; set; }
        public string windSpeed { get; set; }
        public string humidity { get; set; }
        public string precip { get; set; }
        public string pressure { get; set; }
        public string vis { get; set; }
        public string cloud { get; set; }
        public string dew { get; set; }
        //编写toString方法
        public override string ToString()
        {
            return $"Observation Time: {obsTime}\n" +
                   $"Temperature: {temp} °C\n" +
                   $"Feels Like: {feelsLike} °C\n" +
                   $"Weather: {text}\n" +
                   $"Wind Direction: {windDir} ({wind360}°)\n" +
                   $"Wind Speed: {windSpeed} km/h\n" +
                   $"Humidity: {humidity}%\n" +
                   $"Pressure: {pressure} hPa\n" +
                   $"Visibility: {vis} km\n" +
                   $"Cloud: {cloud}%\n" +
                   $"Dew Point: {dew} °C";
        }
    }

    public class Refer
    {
        public string[] sources { get; set; }
        public string[] license { get; set; }
    }
}
